package com.wrk._1_语法._03_分支;

import java.util.Scanner;

public class _012_水仙花数 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个3位数,判断是否为水仙花数");
        //定义变量
        int number = scanner.nextInt();
        int digit1 =0;
        int digit2 =0;
        int digit3 =0;
        //获取每一位数
        digit1= number%10;
        digit2 =(number/10)%10;
        digit3 =(number/100)%10;
        //判断
        if (Math.pow(digit1,3)+Math.pow(digit2,3)+Math.pow(digit3,3)==number){
            System.out.println("是水仙花数");
        }else {
            System.out.println("不是水仙花数");
        }scanner.close();
    }
}
